<?php if($this->session->flashdata('message_status') != "" && $this->session->flashdata('message_status') == "0"): ?>
	<div class="alert alert-danger">
		<i class="fa fa-fw fa-times-circle"></i> <?php echo $this->session->flashdata('message'); ?>
	</div>
<?php elseif($this->session->flashdata('message_status') == "1"): ?>
	<div class="alert alert-success">
		<i class="fa fa-fw fa-check-circle"></i> <?php echo $this->session->flashdata('message'); ?>
	</div>
<?php endif; ?>

<form action="<?php echo site_url("Category/update_category_process/$result[id_category]") ?>" method="post">
	<table class="table table-bordered">
		<tr>
			<td width="10%">Category Name</td>
			<td>
				<input type="text" name="cat_name" class="form-control" value="<?php echo $result['category_name'] ?>" required/>
			</td>
			<td>
				<select class="form-control">
					<option selected="selected">Existing Categories</option>
					<?php foreach($category as $cat_data): ?>
						<option><?php echo $cat_data['category_name'] ?></option>
					<?php endforeach; ?>
				</select>
			</td>
			<td width="10%">Category Icon<small>Ex: home</small></td>
			<td width="10%">
				<input type="text" name="cat_icon" class="form-control" value="<?php echo $result['category_icon'] ?>" required/>
			</td>
			<td width="12%">Category Color<small>Ex: #1cafff</small></td>
			<td width="10%">
				<input type="text" name="cat_color" class="form-control" value="<?php echo $result['category_color'] ?>" required/>
			</td>

			<td>
				<input type="submit" name="btn_cat_update" value="Update Category" class="btn btn-primary" />
			</td>
		</tr>
	</table>
	<small><a href="<?php echo site_url('Admin/category') ?>"><i class="fa fa-arrow-left"></i> Back to category list</a></small>
</form>